﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace CommunitySystem
{
    public class Worker
    {
        public static MainPage MainPage;
        public static Grid BusyGrid;
        public static BusyIndicator Indicator;
        public static Frame PageFrame;

        public static bool IsBusy
        {
            get { return Indicator.IsBusy; }
            set { BusyGrid.Visibility = value ? Visibility.Visible : Visibility.Collapsed; Indicator.IsBusy = value; }
        }

        public static Size WorkAreaSize
        {
            get { return new Size(MainPage.ActualWidth, MainPage.ActualHeight); }
        }

        public static void Navigate(string uri)
        {
            PageFrame.Navigate(new Uri(uri, UriKind.Relative));
        }
    }
}
